package com.eorchis.module.trainingneeds.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import java.util.Date;
import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;


import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.department.domain.Department;
import com.eorchis.module.user.domain.User;

/**
 * Title: Questionnaire<br>
 * Description: 培训需求问卷表实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author HuangTF
 * @createDate 2014-02-07
 * @version $Revision$
 */
@Entity
@Table(name = "QUESTIONNAIRE")
public class Questionnaire extends AbstractBaseEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	/**
	 * 已发布
	 */
	public static final Integer IS_PUBLISH_Y=new Integer(1);
	/**
	 * 未发布
	 */
	public static final Integer IS_PUBLISH_N=new Integer(2);
	/**
	 * 活动状态：活动
	 */
	public static final Integer IS_ACTIVE_Y = new Integer(1);
	/**
	 * 活动状态：作废
	 */
	public static final Integer IS_ACTIVE_N = new Integer(2);
	
	/**
	 * 问卷类型   1:班级问卷 
	 */
	public static final Integer QUESTIONNAIRE_CLASS = new Integer(1);
	/**
	 * 问卷类型   2:个人问卷
	 */
	public static final Integer QUESTIONNAIRE_USER = new Integer(2);
	
	
	private String questionnaireId;//问卷ID
	private String questionnaireName;//问卷名称
	private BaseData questionnaireType;//问卷类型,数据字典获取
	private Date beginDate;//开始时间
	private Date endDate;//结束时间
	private User user;//创建人
	private Department department;//创建单位
	private Integer surveyType;//调查方式(1:电子问卷)
	private String questionnaireExplain;//问卷说明
	private Integer publishState;//发布状态(1:已发布 2:未发布)
	private Integer surveyObjectType;//调查对象类型   1：全体   2：指定人员
	
	public Questionnaire(){}
	public Questionnaire(String questionnaireId)
	{
		this.questionnaireId=questionnaireId;
	}
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="QUESTIONNAIRE_ID")
	/**
	 * 设置问卷ID
	 */		
	public String getQuestionnaireId() {
		return questionnaireId;
	}
	/**
	 * 获取问卷ID
	 */		
	public void setQuestionnaireId(String questionnaireId) {
		this.questionnaireId = questionnaireId;
	}
	@Column(name="QUESTIONNAIRE_NAME")
	/**
	 * 设置问卷名称
	 */		
	public String getQuestionnaireName() {
		return questionnaireName;
	}
	/**
	 * 获取问卷名称
	 */		
	public void setQuestionnaireName(String questionnaireName) {
		this.questionnaireName = questionnaireName;
	}
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="QUESTIONNAIRE_TYPE")
	/**
	 * 设置问卷类型,数据字典获取
	 */		
	public BaseData getQuestionnaireType() {
		return questionnaireType;
	}
	/**
	 * 获取问卷类型,数据字典获取
	 */		
	public void setQuestionnaireType(BaseData questionnaireType) {
		this.questionnaireType = questionnaireType;
	}
	@Column(name="BEGIN_DATE")
	/**
	 * 设置开始时间
	 */		
	public Date getBeginDate() {
		return beginDate;
	}
	/**
	 * 获取开始时间
	 */		
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	@Column(name="END_DATE")
	/**
	 * 设置结束时间
	 */		
	public Date getEndDate() {
		return endDate;
	}
	/**
	 * 获取结束时间
	 */		
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="USERID")
	/**
	 * 设置用户
	 */		
	public User getUser() {
		return user;
	}
	/**
	 * 获取用户
	 */		
	public void setUser(User user) {
		this.user = user;
	}
	/**
	 * 设置部门编号
	 */		
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="DEPID")
	public Department getDepartment() {
		return department;
	}
	/**
	 * 获取部门编号
	 */		
	public void setDepartment(Department department) {
		this.department = department;
	}
	@Column(name="SURVEY_TYPE")
	/**
	 * 设置调查方式(1:电子问卷)
	 */		
	public Integer getSurveyType() {
		return surveyType;
	}
	/**
	 * 获取调查方式(1:电子问卷)
	 */		
	public void setSurveyType(Integer surveyType) {
		this.surveyType = surveyType;
	}
	@Column(name="QUESTIONNAIRE_EXPLAIN")
	/**
	 * 设置问卷说明
	 */		
	public String getQuestionnaireExplain() {
		return questionnaireExplain;
	}
	/**
	 * 获取问卷说明
	 */		
	public void setQuestionnaireExplain(String questionnaireExplain) {
		this.questionnaireExplain = questionnaireExplain;
	}
	@Column(name="PUBLISH_STATE")
	/**
	 * 设置发布状态(1:发布 2:未发布)
	 */		
	public Integer getPublishState() {
		return publishState;
	}
	/**
	 * 获取发布状态(1:发布 2:未发布)
	 */		
	public void setPublishState(Integer publishState) {
		this.publishState = publishState;
	}
	@Column(name="SURVEY_OBJECT_TYPE")
	/**
	 * 获取调查对象类型   1：全体   2：指定人员
	 */	
	public Integer getSurveyObjectType() {
		return surveyObjectType;
	}
	/**
	 * 设置调查对象类型   1：全体   2：指定人员
	 */	
	public void setSurveyObjectType(Integer surveyObjectType) {
		this.surveyObjectType = surveyObjectType;
	}
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "问卷ID======>" + getQuestionnaireId()+"\n问卷名称======>" + getQuestionnaireName()+"\n问卷类型(1:班级问卷)======>" + getQuestionnaireType()+"\n开始时间======>" + getBeginDate()+"\n结束时间======>" + getEndDate()+"\n调查方式(1:电子问卷)======>" + getSurveyType()+"\n问卷说明======>" + getQuestionnaireExplain()+"\n发布状态(1:发布 2:未发布)======>" + getPublishState();
	}
}
